package com.cosyhut.blocks.factory;

public abstract class MGeom {
	protected String _name;
	protected int _type;
	protected Material _material;
	
	protected float _volume;
	protected float _mass;

	protected MGeom(String name, int type, Material material) {
		this._name = name;
		this._type = type;
		this._material = material;
	}

	protected void init() {
		this.calculateVolume();
		this._mass = this._volume * this._material.getDensity();
	}

	//--------------------------------------------------------------------------
	public float getVolume() {
		return this._volume;
	}
	public String getName() {
		return this._name;
	}
    public int getType() {
    	return this._type;
    }
    public Material getMaterial() {
    	return this._material;
    }
	//--------------------------------------------------------------------------
	protected abstract void calculateVolume();
	
}
